Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: Source/bindings/v8/DOMWrapperWorld.h

Issue 257803006: Fixing wrong extension ID in Activity Log entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bug fix Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/bindings/v8/DOMWrapperWorld.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 #include "wtf/RefCounted.h" 38 #include "wtf/RefCounted.h"
39 #include "wtf/RefPtr.h" 39 #include "wtf/RefPtr.h"
40 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
41 #include <v8.h> 41 #include <v8.h>
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 class DOMDataStore; 45 class DOMDataStore;
46 class ExecutionContext; 46 class ExecutionContext;
47 class ScriptController; 47 class ScriptController;
48 class V8DOMActivityLogger;
49 48
50 enum WorldIdConstants { 49 enum WorldIdConstants {
51 MainWorldId = 0, 50 MainWorldId = 0,
52 // Embedder isolated worlds can use IDs in [1, 1<<29). 51 // Embedder isolated worlds can use IDs in [1, 1<<29).
53 EmbedderWorldIdLimit = (1 << 29), 52 EmbedderWorldIdLimit = (1 << 29),
54 ScriptPreprocessorIsolatedWorldId, 53 ScriptPreprocessorIsolatedWorldId,
55 IsolatedWorldIdLimit, 54 IsolatedWorldIdLimit,
56 WorkerWorldId, 55 WorkerWorldId,
57 TestingWorldId, 56 TestingWorldId,
58 }; 57 };
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 static void setIsolatedWorldContentSecurityPolicy(int worldId, const String& policy); 105 static void setIsolatedWorldContentSecurityPolicy(int worldId, const String& policy);
107 bool isolatedWorldHasContentSecurityPolicy(); 106 bool isolatedWorldHasContentSecurityPolicy();
108 107
109 bool isMainWorld() const { return m_worldId == MainWorldId; } 108 bool isMainWorld() const { return m_worldId == MainWorldId; }
110 bool isWorkerWorld() const { return m_worldId == WorkerWorldId; } 109 bool isWorkerWorld() const { return m_worldId == WorkerWorldId; }
111 bool isIsolatedWorld() const { return MainWorldId < m_worldId && m_worldId < IsolatedWorldIdLimit; } 110 bool isIsolatedWorld() const { return MainWorldId < m_worldId && m_worldId < IsolatedWorldIdLimit; }
112 111
113 int worldId() const { return m_worldId; } 112 int worldId() const { return m_worldId; }
114 int extensionGroup() const { return m_extensionGroup; } 113 int extensionGroup() const { return m_extensionGroup; }
115 DOMDataStore& domDataStore() const { return *m_domDataStore; } 114 DOMDataStore& domDataStore() const { return *m_domDataStore; }
116 V8DOMActivityLogger* activityLogger() const { return m_activityLogger; }
117 void setActivityLogger(V8DOMActivityLogger* activityLogger) { m_activityLogg er = activityLogger; }
118 115
119 static void setWorldOfInitializingWindow(DOMWrapperWorld* world) 116 static void setWorldOfInitializingWindow(DOMWrapperWorld* world)
120 { 117 {
121 ASSERT(isMainThread()); 118 ASSERT(isMainThread());
122 worldOfInitializingWindow = world; 119 worldOfInitializingWindow = world;
123 } 120 }
124 // FIXME: Remove this method once we fix crbug.com/345014. 121 // FIXME: Remove this method once we fix crbug.com/345014.
125 static bool windowIsBeingInitialized() { return !!worldOfInitializingWindow; } 122 static bool windowIsBeingInitialized() { return !!worldOfInitializingWindow; }
126 123
127 private: 124 private:
128 DOMWrapperWorld(int worldId, int extensionGroup); 125 DOMWrapperWorld(int worldId, int extensionGroup);
129 126
130 static unsigned isolatedWorldCount; 127 static unsigned isolatedWorldCount;
131 static DOMWrapperWorld* worldOfInitializingWindow; 128 static DOMWrapperWorld* worldOfInitializingWindow;
132 129
133 const int m_worldId; 130 const int m_worldId;
134 const int m_extensionGroup; 131 const int m_extensionGroup;
135 OwnPtr<DOMDataStore> m_domDataStore; 132 OwnPtr<DOMDataStore> m_domDataStore;
136 // This is owned by a static hash map in V8DOMActivityLogger.
137 V8DOMActivityLogger* m_activityLogger;
138 }; 133 };
139 134
140 } // namespace WebCore 135 } // namespace WebCore
141 136
142 #endif // DOMWrapperWorld_h 137 #endif // DOMWrapperWorld_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/bindings/v8/DOMWrapperWorld.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698