summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authornoelutz@google.com <noelutz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 22:14:13 +0000
committernoelutz@google.com <noelutz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 22:14:13 +0000
commit1331397732bfd1a2ed9d63d92bbc2a61185bd666 (patch)
tree8f1f3367488e6749911a4db78f8ee5e67be91b6e /chrome/common
parent28b791a577a84f316d78b37d3bea97a119215a0f (diff)
downloadchromium_src-1331397732bfd1a2ed9d63d92bbc2a61185bd666.zip
chromium_src-1331397732bfd1a2ed9d63d92bbc2a61185bd666.tar.gz
chromium_src-1331397732bfd1a2ed9d63d92bbc2a61185bd666.tar.bz2
Change the client-side phishing detection request format. Instead of
just sending the URL with the computed score we also send back all the extracted features. BUG=NONE TEST=ClientSideDetectionHostTest,ClientSideDetectionServiceTest,PhishingClassifierTest,PhishingClassifierDelegateTest Review URL: http://codereview.chromium.org/6810020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/common_message_generator.h4
-rw-r--r--chrome/common/safe_browsing/csd.proto50
-rw-r--r--chrome/common/safe_browsing/safebrowsing_messages.h (renamed from chrome/common/safebrowsing_messages.h)11
3 files changed, 58 insertions, 7 deletions
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h
index 0d1f4eb..ddeac89 100644
--- a/chrome/common/common_message_generator.h
+++ b/chrome/common/common_message_generator.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,7 +9,7 @@
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/safebrowsing_messages.h"
+#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "chrome/common/service_messages.h"
#include "chrome/common/spellcheck_messages.h"
#include "chrome/common/utility_messages.h"
diff --git a/chrome/common/safe_browsing/csd.proto b/chrome/common/safe_browsing/csd.proto
new file mode 100644
index 0000000..6b737b30
--- /dev/null
+++ b/chrome/common/safe_browsing/csd.proto
@@ -0,0 +1,50 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Client side phishing and malware detection request and response
+// protocol buffers. Those protocol messages should be kept in sync
+// with the server implementation.
+//
+// If you want to change this protocol definition or you have questions
+// regarding its format please contact chrome-anti-phishing@googlegroups.com.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package safe_browsing;
+
+message ClientPhishingRequest {
+ // URL that the client visited. The CGI parameters are stripped by the
+ // client.
+ required string url = 1;
+
+ // Score that was computed on the client. Value is between 0.0 and 1.0.
+ // The larger the value the more likely the url is phishing.
+ required float client_score = 2;
+
+ // Note: we're skipping tag 3 because it was previously used.
+
+ // Is true if the features for this URL were classified as phishing.
+ // Currently, this will always be true for all client-phishing requests
+ // that are sent to the server.
+ optional bool is_phishing = 4;
+
+ message Feature {
+ // Feature name. E.g., 'PageHasForms'.
+ required string name = 1;
+
+ // Feature value is always in the range [0.0, 1.0]. Boolean features
+ // have value 1.0.
+ required double value = 2;
+ }
+
+ // List of features that were extracted. Those are the features that were
+ // sent to the scorer and which resulted in client_score being computed.
+ repeated Feature feature_map = 5;
+}
+
+message ClientPhishingResponse {
+ required bool phishy = 1;
+}
diff --git a/chrome/common/safebrowsing_messages.h b/chrome/common/safe_browsing/safebrowsing_messages.h
index a0fc7f9..b3fa05b 100644
--- a/chrome/common/safebrowsing_messages.h
+++ b/chrome/common/safe_browsing/safebrowsing_messages.h
@@ -29,11 +29,12 @@ IPC_STRUCT_END()
// SafeBrowsing client-side detection messages sent from the renderer to the
// browser.
-// Inform the browser that the current URL is phishing according to the
-// client-side phishing detector.
-IPC_MESSAGE_ROUTED2(SafeBrowsingHostMsg_DetectedPhishingSite,
- GURL /* phishing_url */,
- double /* phishing_score */)
+// Inform the browser that the URL in the given ClientPhishingRequest proto is
+// phishing according to the client-side phishing detector.
+// TODO(noelutz): we may want to create custom ParamTraits for MessageLite to
+// have a generic way to send protocol messages over IPC.
+IPC_MESSAGE_ROUTED1(SafeBrowsingHostMsg_DetectedPhishingSite,
+ std::string /* encoded ClientPhishingRequest proto */)
// Send part of the DOM to the browser, to be used in a malware report.
IPC_MESSAGE_ROUTED1(SafeBrowsingHostMsg_MalwareDOMDetails,