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

Side by Side Diff: src/inspector/v8-console.cc

Issue 2467853003: [inspector] migrate Runtime to new style (Closed)
Patch Set: removed redundant "ErrorString errorString;" Created 4 years, 1 month 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project 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 "src/inspector/v8-console.h" 5 #include "src/inspector/v8-console.h"
6 6
7 #include "src/base/macros.h" 7 #include "src/base/macros.h"
8 #include "src/inspector/injected-script.h" 8 #include "src/inspector/injected-script.h"
9 #include "src/inspector/inspected-context.h" 9 #include "src/inspector/inspected-context.h"
10 #include "src/inspector/string-util.h" 10 #include "src/inspector/string-util.h"
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 static void inspectImpl(const v8::FunctionCallbackInfo<v8::Value>& info, 611 static void inspectImpl(const v8::FunctionCallbackInfo<v8::Value>& info,
612 bool copyToClipboard) { 612 bool copyToClipboard) {
613 if (info.Length() < 1) return; 613 if (info.Length() < 1) return;
614 if (!copyToClipboard) info.GetReturnValue().Set(info[0]); 614 if (!copyToClipboard) info.GetReturnValue().Set(info[0]);
615 615
616 ConsoleHelper helper(info); 616 ConsoleHelper helper(info);
617 InspectedContext* context = helper.ensureInspectedContext(); 617 InspectedContext* context = helper.ensureInspectedContext();
618 if (!context) return; 618 if (!context) return;
619 InjectedScript* injectedScript = context->getInjectedScript(); 619 InjectedScript* injectedScript = context->getInjectedScript();
620 if (!injectedScript) return; 620 if (!injectedScript) return;
621 ErrorString errorString; 621 std::unique_ptr<protocol::Runtime::RemoteObject> wrappedObject;
622 std::unique_ptr<protocol::Runtime::RemoteObject> wrappedObject = 622 injectedScript->wrapObject(info[0], "", false /** forceValueType */,
623 injectedScript->wrapObject(&errorString, info[0], "", 623 false /** generatePreview */, wrappedObject);
624 false /** forceValueType */, 624 if (!wrappedObject) return;
dgozman 2016/11/02 19:54:00 Check the response instead.
kozy 2016/11/02 22:45:13 Done.
625 false /** generatePreview */);
626 if (!wrappedObject || !errorString.isEmpty()) return;
627 625
628 std::unique_ptr<protocol::DictionaryValue> hints = 626 std::unique_ptr<protocol::DictionaryValue> hints =
629 protocol::DictionaryValue::create(); 627 protocol::DictionaryValue::create();
630 if (copyToClipboard) hints->setBoolean("copyToClipboard", true); 628 if (copyToClipboard) hints->setBoolean("copyToClipboard", true);
631 if (V8InspectorSessionImpl* session = helper.currentSession()) 629 if (V8InspectorSessionImpl* session = helper.currentSession())
632 session->runtimeAgent()->inspect(std::move(wrappedObject), 630 session->runtimeAgent()->inspect(std::move(wrappedObject),
633 std::move(hints)); 631 std::move(hints));
634 } 632 }
635 633
636 void V8Console::inspectCallback( 634 void V8Console::inspectCallback(
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 ->GetOwnPropertyDescriptor( 911 ->GetOwnPropertyDescriptor(
914 m_context, v8::Local<v8::String>::Cast(name)) 912 m_context, v8::Local<v8::String>::Cast(name))
915 .ToLocal(&descriptor); 913 .ToLocal(&descriptor);
916 DCHECK(success); 914 DCHECK(success);
917 USE(success); 915 USE(success);
918 } 916 }
919 } 917 }
920 } 918 }
921 919
922 } // namespace v8_inspector 920 } // namespace v8_inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698