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

Side by Side Diff: Source/bindings/core/v8/V8DOMActivityLogger.cpp

Issue 559813002: Add HandleScopes to V8DOMActivityLogger's methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "bindings/core/v8/V8DOMActivityLogger.h" 6 #include "bindings/core/v8/V8DOMActivityLogger.h"
7 7
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 #include "platform/weborigin/KURL.h" 9 #include "platform/weborigin/KURL.h"
10 #include "wtf/HashMap.h" 10 #include "wtf/HashMap.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 return activityLogger(worldId, url.host()); 69 return activityLogger(worldId, url.host());
70 } 70 }
71 71
72 V8DOMActivityLogger* V8DOMActivityLogger::currentActivityLogger() 72 V8DOMActivityLogger* V8DOMActivityLogger::currentActivityLogger()
73 { 73 {
74 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 74 v8::Isolate* isolate = v8::Isolate::GetCurrent();
75 if (!isolate->InContext()) 75 if (!isolate->InContext())
76 return 0; 76 return 0;
77 77
78 v8::HandleScope handleScope(isolate);
78 v8::Handle<v8::Context> context = isolate->GetCurrentContext(); 79 v8::Handle<v8::Context> context = isolate->GetCurrentContext();
79 if (context.IsEmpty() || !toDOMWindow(context)) 80 if (context.IsEmpty() || !toDOMWindow(context))
80 return 0; 81 return 0;
81 82
82 V8PerContextData* contextData = ScriptState::from(context)->perContextData() ; 83 V8PerContextData* contextData = ScriptState::from(context)->perContextData() ;
83 if (!contextData) 84 if (!contextData)
84 return 0; 85 return 0;
85 86
86 return contextData->activityLogger(); 87 return contextData->activityLogger();
87 } 88 }
88 89
89 V8DOMActivityLogger* V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld() 90 V8DOMActivityLogger* V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld()
90 { 91 {
91 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 92 v8::Isolate* isolate = v8::Isolate::GetCurrent();
92 if (!isolate->InContext()) 93 if (!isolate->InContext())
93 return 0; 94 return 0;
94 95
96 v8::HandleScope handleScope(isolate);
95 v8::Handle<v8::Context> context = isolate->GetCurrentContext(); 97 v8::Handle<v8::Context> context = isolate->GetCurrentContext();
96 if (context.IsEmpty() || !toDOMWindow(context)) 98 if (context.IsEmpty() || !toDOMWindow(context))
97 return 0; 99 return 0;
98 100
99 ScriptState* scriptState = ScriptState::from(context); 101 ScriptState* scriptState = ScriptState::from(context);
100 if (!scriptState->world().isIsolatedWorld()) 102 if (!scriptState->world().isIsolatedWorld())
101 return 0; 103 return 0;
102 104
103 V8PerContextData* contextData = scriptState->perContextData(); 105 V8PerContextData* contextData = scriptState->perContextData();
104 if (!contextData) 106 if (!contextData)
105 return 0; 107 return 0;
106 108
107 return contextData->activityLogger(); 109 return contextData->activityLogger();
108 } 110 }
109 111
110 } // namespace blink 112 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698