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

Side by Side Diff: Source/WebCore/bindings/v8/ScriptObject.cpp

Issue 13646003: DevTools: Remove ENABLE(INSPECTOR) and ENABLE(JAVASCRIPT_DEBUGGER) from the code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 7 years, 8 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return v8::Local<v8::Object>(v8::Object::Cast(*v8Value())); 62 return v8::Local<v8::Object>(v8::Object::Cast(*v8Value()));
63 } 63 }
64 64
65 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S criptObject& value) 65 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S criptObject& value)
66 { 66 {
67 ScriptScope scope(scriptState); 67 ScriptScope scope(scriptState);
68 scope.global()->Set(v8::String::NewSymbol(name), value.v8Value()); 68 scope.global()->Set(v8::String::NewSymbol(name), value.v8Value());
69 return scope.success(); 69 return scope.success();
70 } 70 }
71 71
72 #if ENABLE(INSPECTOR)
73 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Inspect orFrontendHost* value) 72 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Inspect orFrontendHost* value)
74 { 73 {
75 ScriptScope scope(scriptState); 74 ScriptScope scope(scriptState);
76 scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8:: Object>(), scriptState->isolate())); 75 scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8:: Object>(), scriptState->isolate()));
77 return scope.success(); 76 return scope.success();
78 } 77 }
79 78
80 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Injecte dScriptHost* value) 79 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Injecte dScriptHost* value)
81 { 80 {
82 ScriptScope scope(scriptState); 81 ScriptScope scope(scriptState);
83 scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8:: Object>(), scriptState->isolate())); 82 scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8:: Object>(), scriptState->isolate()));
84 return scope.success(); 83 return scope.success();
85 } 84 }
86 #endif
87 85
88 bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptO bject& value) 86 bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptO bject& value)
89 { 87 {
90 ScriptScope scope(scriptState); 88 ScriptScope scope(scriptState);
91 v8::Local<v8::Value> v8Value = scope.global()->Get(v8::String::NewSymbol(nam e)); 89 v8::Local<v8::Value> v8Value = scope.global()->Get(v8::String::NewSymbol(nam e));
92 if (v8Value.IsEmpty()) 90 if (v8Value.IsEmpty())
93 return false; 91 return false;
94 92
95 if (!v8Value->IsObject()) 93 if (!v8Value->IsObject())
96 return false; 94 return false;
97 95
98 value = ScriptObject(scriptState, v8::Handle<v8::Object>(v8::Object::Cast(*v 8Value))); 96 value = ScriptObject(scriptState, v8::Handle<v8::Object>(v8::Object::Cast(*v 8Value)));
99 return true; 97 return true;
100 } 98 }
101 99
102 bool ScriptGlobalObject::remove(ScriptState* scriptState, const char* name) 100 bool ScriptGlobalObject::remove(ScriptState* scriptState, const char* name)
103 { 101 {
104 ScriptScope scope(scriptState); 102 ScriptScope scope(scriptState);
105 return scope.global()->Delete(v8::String::NewSymbol(name)); 103 return scope.global()->Delete(v8::String::NewSymbol(name));
106 } 104 }
107 105
108 } // namespace WebCore 106 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/bindings/v8/ScriptGCEvent.cpp ('k') | Source/WebCore/bindings/v8/ScriptProfile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698