summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 20:21:59 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 20:21:59 +0000
commit7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90 (patch)
tree2f283b622f4ee681e05e7e6119903146f6f4d1ea /chrome/renderer
parentd2515f6e52f42d4baaa3c676ba1370ffa1f263eb (diff)
downloadchromium_src-7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90.zip
chromium_src-7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90.tar.gz
chromium_src-7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90.tar.bz2
Stop serializing WebString over IPC. The new rule is that only POD (plain old
data) types from WebKit API are allowed to be used in the browser process. I added a big note about this to webkit_param_traits.h to explain the details of this decision. R=dglazkov Review URL: http://codereview.chromium.org/62032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc34
-rw-r--r--chrome/renderer/render_view.h11
2 files changed, 27 insertions, 18 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index e94452e..0b36bd0 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2131,7 +2131,9 @@ GURL RenderView::GetAlternateErrorPageURL(const GURL& failedURL,
return url;
}
-void RenderView::OnFind(const WebKit::WebFindInPageRequest& request) {
+void RenderView::OnFind(int request_id,
+ const string16& search_text,
+ const WebKit::WebFindOptions& options) {
WebFrame* main_frame = webview()->GetMainFrame();
WebFrame* frame_after_main = webview()->GetNextFrameAfter(main_frame, true);
WebFrame* focused_frame = webview()->GetFocusedFrame();
@@ -2147,7 +2149,8 @@ void RenderView::OnFind(const WebKit::WebFindInPageRequest& request) {
bool result = false;
do {
- result = search_frame->Find(request, wrap_within_frame, &selection_rect);
+ result = search_frame->Find(
+ request_id, search_text, options, wrap_within_frame, &selection_rect);
if (!result) {
// don't leave text selected as you move to the next frame.
@@ -2157,7 +2160,7 @@ void RenderView::OnFind(const WebKit::WebFindInPageRequest& request) {
do {
// What is the next frame to search? (we might be going backwards). Note
// that we specify wrap=true so that search_frame never becomes NULL.
- search_frame = request.forward ?
+ search_frame = options.forward ?
webview()->GetNextFrameAfter(search_frame, true) :
webview()->GetPreviousFrameBefore(search_frame, true);
} while (!search_frame->Visible() && search_frame != focused_frame);
@@ -2171,8 +2174,9 @@ void RenderView::OnFind(const WebKit::WebFindInPageRequest& request) {
// reported matches, but no frames after the focused_frame contain a
// match for the search word(s).
if (multi_frame && search_frame == focused_frame) {
- result = search_frame->Find(request, true, // Force wrapping.
- &selection_rect);
+ result = search_frame->Find(
+ request_id, search_text, options, true, // Force wrapping.
+ &selection_rect);
}
}
@@ -2191,9 +2195,9 @@ void RenderView::OnFind(const WebKit::WebFindInPageRequest& request) {
// fix for 792423.
webview()->SetFocusedFrame(NULL);
- if (request.findNext) {
+ if (options.findNext) {
// Force the main_frame to report the actual count.
- main_frame->IncreaseMatchCount(0, request.identifier);
+ main_frame->IncreaseMatchCount(0, request_id);
} else {
// If nothing is found, set result to "0 of 0", otherwise, set it to
// "-1 of 1" to indicate that we found at least one item, but we don't know
@@ -2207,7 +2211,7 @@ void RenderView::OnFind(const WebKit::WebFindInPageRequest& request) {
// Send the search result over to the browser process.
Send(new ViewHostMsg_Find_Reply(routing_id_,
- request.identifier,
+ request_id,
match_count,
selection_rect,
ordinal,
@@ -2227,7 +2231,9 @@ void RenderView::OnFind(const WebKit::WebFindInPageRequest& request) {
if (result) {
// Start new scoping request. If the scoping function determines that it
// needs to scope, it will defer until later.
- search_frame->ScopeStringMatches(request,
+ search_frame->ScopeStringMatches(request_id,
+ search_text,
+ options,
true); // reset the tickmarks
}
@@ -2524,11 +2530,13 @@ void RenderView::OnCSSInsertRequest(const std::wstring& frame_xpath,
InsertCSS(frame_xpath, css);
}
-void RenderView::OnAddMessageToConsole(const std::wstring& frame_xpath,
- const WebConsoleMessage& message) {
- WebFrame* web_frame = GetChildFrame(frame_xpath);
+void RenderView::OnAddMessageToConsole(
+ const string16& frame_xpath,
+ const string16& message,
+ const WebConsoleMessage::Level& level) {
+ WebFrame* web_frame = GetChildFrame(UTF16ToWideHack(frame_xpath));
if (web_frame)
- web_frame->AddMessageToConsole(message);
+ web_frame->AddMessageToConsole(WebConsoleMessage(level, message));
}
#if defined(OS_WIN)
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 44dcbc4..7f19567 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -26,6 +26,7 @@
#include "chrome/renderer/render_widget.h"
#include "media/audio/audio_output.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
#include "webkit/glue/dom_serializer_delegate.h"
#include "webkit/glue/feed.h"
#include "webkit/glue/form_data.h"
@@ -75,8 +76,7 @@ struct FileUploadData;
}
namespace WebKit {
-struct WebConsoleMessage;
-struct WebFindInPageRequest;
+struct WebFindOptions;
}
// We need to prevent a page from trying to create infinite popups. It is not
@@ -494,7 +494,7 @@ class RenderView : public RenderWidget,
void OnShowJavaScriptConsole();
void OnSetupDevToolsClient();
void OnCancelDownload(int32 download_id);
- void OnFind(const WebKit::WebFindInPageRequest& request);
+ void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&);
void OnZoom(int function);
void OnInsertText(const string16& text);
void OnSetPageEncoding(const std::wstring& encoding_name);
@@ -528,8 +528,9 @@ class RenderView : public RenderWidget,
const std::wstring& jscript);
void OnCSSInsertRequest(const std::wstring& frame_xpath,
const std::string& css);
- void OnAddMessageToConsole(const std::wstring& frame_xpath,
- const WebKit::WebConsoleMessage&);
+ void OnAddMessageToConsole(const string16& frame_xpath,
+ const string16& message,
+ const WebKit::WebConsoleMessage::Level&);
void OnDebugAttach();
void OnReservePageIDRange(int size_of_range);