Bug 819791 - Part 5: Remove an unnecessary TArray copy in hal/sandbox. r=mounir
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 18 Dec 2012 20:16:06 -0500
changeset 116481 160c727a336b0dd9b33183f46201488d92414716
parent 116480 3877a7a5fdf6040adf950d3a367971862dda252c
child 116482 269b0c198fdb028adf981e2b0d81bf2c9ca7c46f
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmounir
bugs819791
milestone20.0a1
Bug 819791 - Part 5: Remove an unnecessary TArray copy in hal/sandbox. r=mounir
hal/sandbox/SandboxHal.cpp
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -432,18 +432,17 @@ public:
               const InfallibleTArray<uint64_t> &id,
               PBrowserParent *browserParent) MOZ_OVERRIDE
   {
     // We give all content vibration permission.
     TabParent *tabParent = static_cast<TabParent*>(browserParent);
     nsCOMPtr<nsIDOMWindow> window =
       do_QueryInterface(tabParent->GetBrowserDOMWindow());
     WindowIdentifier newID(id, window);
-    // Have to copy, because Vibrate doesn't take a compatible array type
-    hal::Vibrate(nsTArray<uint32_t>(pattern), newID);
+    hal::Vibrate(pattern, newID);
     return true;
   }
 
   virtual bool
   RecvCancelVibrate(const InfallibleTArray<uint64_t> &id,
                     PBrowserParent *browserParent) MOZ_OVERRIDE
   {
     TabParent *tabParent = static_cast<TabParent*>(browserParent);