summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2013-08-28 10:43:39 +0300
committerVaadin Code Review <review@vaadin.com>2013-08-28 09:16:48 +0000
commit232eb4238d89fe5d310c343c23ed2424d5ef9822 (patch)
treee02cae2d2df750444c55fd5c9a2c334a1fcd8d13
parent8ce45c7bedc2ef04db9f7d34fd214fe0b8079926 (diff)
downloadvaadin-framework-232eb4238d89fe5d310c343c23ed2424d5ef9822.tar.gz
vaadin-framework-232eb4238d89fe5d310c343c23ed2424d5ef9822.zip
Enable use of profiler without debug window (#12465)
This change also corrects a typo in the name of the internal method setProfilerResultConsumer() Change-Id: I877858d992611512ee681022312de7a9bfa4cd39
-rw-r--r--client/src/com/vaadin/client/Profiler.java18
-rw-r--r--client/src/com/vaadin/client/debug/internal/ProfilerSection.java2
2 files changed, 10 insertions, 10 deletions
diff --git a/client/src/com/vaadin/client/Profiler.java b/client/src/com/vaadin/client/Profiler.java
index bcbf8279f3..083f2559b1 100644
--- a/client/src/com/vaadin/client/Profiler.java
+++ b/client/src/com/vaadin/client/Profiler.java
@@ -273,7 +273,9 @@ public class Profiler {
}
});
- getConsumer().addProfilerData(stack.getFirst(), totalList);
+ if (getConsumer() != null) {
+ getConsumer().addProfilerData(stack.getFirst(), totalList);
+ }
}
/**
@@ -325,7 +327,9 @@ public class Profiler {
return;
}
- getConsumer().addBootstrapData(timings);
+ if (getConsumer() != null) {
+ getConsumer().addBootstrapData(timings);
+ }
}
}
@@ -386,11 +390,11 @@ public class Profiler {
* <b>Warning!</b> This is internal API and should not be used by
* applications or add-ons.
*
- * @since 7.1
+ * @since 7.1.4
* @param profilerResultConsumer
* the consumer that gets profiler data
*/
- public static void setProfilerResultConsuer(
+ public static void setProfilerResultConsumer(
ProfilerResultConsumer profilerResultConsumer) {
if (consumer != null) {
throw new IllegalStateException("The consumer has already been set");
@@ -399,11 +403,7 @@ public class Profiler {
}
private static ProfilerResultConsumer getConsumer() {
- if (consumer == null) {
- throw new IllegalStateException("No consumer has been registered");
- } else {
- return consumer;
- }
+ return consumer;
}
private static Logger getLogger() {
diff --git a/client/src/com/vaadin/client/debug/internal/ProfilerSection.java b/client/src/com/vaadin/client/debug/internal/ProfilerSection.java
index 91f626b9a5..4a2a3a1c38 100644
--- a/client/src/com/vaadin/client/debug/internal/ProfilerSection.java
+++ b/client/src/com/vaadin/client/debug/internal/ProfilerSection.java
@@ -283,7 +283,7 @@ public class ProfilerSection implements Section {
private final FlowPanel content = new FlowPanel();
public ProfilerSection() {
- Profiler.setProfilerResultConsuer(new ProfilerResultConsumer() {
+ Profiler.setProfilerResultConsumer(new ProfilerResultConsumer() {
@Override
public void addProfilerData(Node rootNode, List<Node> totals) {
double totalTime = 0;