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

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

Issue 230813002: Make it possible to have <object>'s scriptableObject as a v8 object instead of NPObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased to current ToT (by raymes - fetched from https://codereview.chromium.org/426853002/) Created 6 years, 4 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
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 return contextData->activityLogger(); 86 return contextData->activityLogger();
87 } 87 }
88 88
89 V8DOMActivityLogger* V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld() 89 V8DOMActivityLogger* V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld()
90 { 90 {
91 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 91 v8::Isolate* isolate = v8::Isolate::GetCurrent();
92 if (!isolate->InContext()) 92 if (!isolate->InContext())
93 return 0; 93 return 0;
94 94
95 v8::HandleScope handleScope(isolate);
abarth-chromium 2014/07/29 17:34:21 Why is this handle scope needed?
Krzysztof Olczyk 2014/07/30 08:40:30 Done.
95 v8::Handle<v8::Context> context = isolate->GetCurrentContext(); 96 v8::Handle<v8::Context> context = isolate->GetCurrentContext();
96 if (context.IsEmpty() || !toDOMWindow(context)) 97 if (context.IsEmpty() || !toDOMWindow(context))
97 return 0; 98 return 0;
98 99
99 ScriptState* scriptState = ScriptState::from(context); 100 ScriptState* scriptState = ScriptState::from(context);
100 if (!scriptState->world().isIsolatedWorld()) 101 if (!scriptState->world().isIsolatedWorld())
101 return 0; 102 return 0;
102 103
103 V8PerContextData* contextData = scriptState->perContextData(); 104 V8PerContextData* contextData = scriptState->perContextData();
104 if (!contextData) 105 if (!contextData)
105 return 0; 106 return 0;
106 107
107 return contextData->activityLogger(); 108 return contextData->activityLogger();
108 } 109 }
109 110
110 } // namespace blink 111 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698