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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10890002: Make V8ValueConverter.FromV8Value behave similarly to JSON.stringify (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ignore -> omit Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 4236 matching lines...) Expand 10 before | Expand all | Expand 10 after
4247 result = web_frame->executeScriptAndReturnValue(WebScriptSource(jscript)); 4247 result = web_frame->executeScriptAndReturnValue(WebScriptSource(jscript));
4248 if (notify_result) { 4248 if (notify_result) {
4249 ListValue list; 4249 ListValue list;
4250 if (!result.IsEmpty() && web_frame) { 4250 if (!result.IsEmpty() && web_frame) {
4251 v8::HandleScope handle_scope; 4251 v8::HandleScope handle_scope;
4252 v8::Local<v8::Context> context = web_frame->mainWorldScriptContext(); 4252 v8::Local<v8::Context> context = web_frame->mainWorldScriptContext();
4253 v8::Context::Scope context_scope(context); 4253 v8::Context::Scope context_scope(context);
4254 V8ValueConverterImpl converter; 4254 V8ValueConverterImpl converter;
4255 converter.SetDateAllowed(true); 4255 converter.SetDateAllowed(true);
4256 converter.SetRegexpAllowed(true); 4256 converter.SetRegexpAllowed(true);
4257 list.Set(0, converter.FromV8Value(result, context)); 4257 base::Value* result_value = converter.FromV8Value(result, context);
4258 list.Set(0, result_value ? result_value :
4259 base::Value::CreateNullValue());
4258 } else { 4260 } else {
4259 list.Set(0, Value::CreateNullValue()); 4261 list.Set(0, Value::CreateNullValue());
4260 } 4262 }
4261 Send(new ViewHostMsg_ScriptEvalResponse(routing_id_, id, list)); 4263 Send(new ViewHostMsg_ScriptEvalResponse(routing_id_, id, list));
4262 } 4264 }
4263 } 4265 }
4264 4266
4265 bool RenderViewImpl::ShouldDisplayScrollbars(int width, int height) const { 4267 bool RenderViewImpl::ShouldDisplayScrollbars(int width, int height) const {
4266 return (!send_preferred_size_changes_ || 4268 return (!send_preferred_size_changes_ ||
4267 (disable_scrollbars_size_limit_.width() <= width || 4269 (disable_scrollbars_size_limit_.width() <= width ||
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
6157 6159
6158 updating_frame_tree_ = true; 6160 updating_frame_tree_ = true;
6159 active_frame_id_map_.clear(); 6161 active_frame_id_map_.clear();
6160 6162
6161 target_process_id_ = process_id; 6163 target_process_id_ = process_id;
6162 target_routing_id_ = route_id; 6164 target_routing_id_ = route_id;
6163 CreateFrameTree(webview()->mainFrame(), frames); 6165 CreateFrameTree(webview()->mainFrame(), frames);
6164 6166
6165 updating_frame_tree_ = false; 6167 updating_frame_tree_ = false;
6166 } 6168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698